/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import com.google.common.cache.Cache;
/*     */ import com.google.common.cache.CacheBuilder;
/*     */ import com.google.common.cache.RemovalListener;
/*     */ import com.google.common.cache.RemovalNotification;
/*     */ import java.util.List;
/*     */ import java.util.Locale;
/*     */ import java.util.Map;
/*     */ import java.util.UUID;
/*     */ import java.util.concurrent.ConcurrentHashMap;
/*     */ import java.util.concurrent.TimeUnit;
/*     */ import net.minecraft.entity.Entity;
/*     */ import net.minecraft.entity.EntityList;
/*     */ import org.yaml.snakeyamla.configuration.file.YamlConfiguration;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class pz
/*     */   implements RemovalListener<UUID, wo>
/*     */ {
/*  23 */   public static pz i = new pz();
/*     */   
/*  25 */   public Map<String, eos/moe/dragoncore/mt> w = new ConcurrentHashMap<>();
/*  26 */   public Map<UUID, String> q = new ConcurrentHashMap<>();
/*     */   public Cache<UUID, wo> g;
/*     */   
/*     */   public pz() {
/*  30 */     CacheBuilder cacheBuilder = CacheBuilder.newBuilder();
/*     */     
/*  32 */     cacheBuilder.removalListener(this);
/*     */     
/*  34 */     cacheBuilder.expireAfterAccess(1L, TimeUnit.SECONDS);
/*  35 */     this.g = cacheBuilder.build();
/*     */   }
/*     */   
/*     */   public Map<String, eos/moe/dragoncore/mt> getYamls() {
/*  39 */     return this.w;
/*     */   }
/*     */ 
/*     */   
/*     */   public String getEntityName(Entity entity) {
/*  44 */     if (this.q.containsKey(entity.func_110124_au())) {
/*  45 */       return this.q.get(entity.func_110124_au());
/*     */     }
/*  47 */     return pa.v(entity.func_145748_c_().func_150260_c().replace(" ", ""));
/*     */   }
/*     */ 
/*     */   
/*     */   public YamlConfiguration getMatchYaml(Entity entity) {
/*  52 */     String str1 = getEntityName(entity);
/*  53 */     String str2 = EntityList.func_75621_b(entity);
/*  54 */     str2 = (str2 == null) ? "unknown" : str2.toLowerCase(Locale.ROOT);
/*  55 */     for (eos/moe/dragoncore/mt eos/moe/dragoncore/mt : this.w.values()) {
/*  56 */       if (eos/moe/dragoncore/mt.v(str2, str1)) {
/*  57 */         return eos/moe/dragoncore/mt.q;
/*     */       }
/*     */     } 
/*  60 */     return null;
/*     */   }
/*     */ 
/*     */   
/*     */   public void onRemoval(RemovalNotification removalNotification) {
/*  65 */     ((wo)removalNotification.getValue()).v(wn.i);
/*  66 */     ((wo)removalNotification.getValue()).c = true;
/*     */   }
/*     */   
/*     */   public static String v(String a) {
/*  70 */     return pa.v(a.replace(" ", ""));
/*     */   }
/*     */   
/*     */   public void clear() {
/*  74 */     this.w.clear();
/*  75 */     this.g.invalidateAll();
/*     */   }
/*     */ 
/*     */   
/*     */   public static class eos/moe/dragoncore/mt
/*     */   {
/*     */     public List<String> i;
/*     */     
/*     */     public boolean w;
/*     */     public YamlConfiguration q;
/*     */     public List<String> g;
/*     */     
/*     */     public eos/moe/dragoncore/mt(YamlConfiguration yamlConfiguration) {
/*  88 */       this.g = yamlConfiguration.getStringList("type");
/*  89 */       this.i = yamlConfiguration.getStringList("match");
/*  90 */       this.w = yamlConfiguration.getBoolean("contains");
/*  91 */       this.i.replaceAll(pz::v);
/*  92 */       this.g.replaceAll(a -> a.toLowerCase(Locale.ROOT));
/*  93 */       this.q = yamlConfiguration;
/*     */     }
/*     */ 
/*     */     
/*     */     public boolean v(String str1, String str2) {
/*  98 */       if (this.g.size() > 0 && 
/*  99 */         !this.g.contains(str1)) {
/* 100 */         return false;
/*     */       }
/*     */ 
/*     */ 
/*     */       
/* 105 */       for (String str : this.i) {
/* 106 */         str = pz.v(str);
/* 107 */         if (this.w) {
/* 108 */           if (str2.contains(str))
/* 109 */             return true;  continue;
/*     */         } 
/* 111 */         if (str2.equals(str)) {
/* 112 */           return true;
/*     */         }
/*     */       } 
/* 115 */       return false;
/*     */     }
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\pz.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */